import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import set from '@dfeidao/atom-web/local/set';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';
import p001 from './p001';
import p002 from './p002';

export default async function a001(fd: IFeidaoAiBrowserComponent, no: string) {// 设置窗口
	// todo
	console.log('zj-000006:a001----start');
	// 显示设置特性关联窗口
	fd.data.node.style.display = 'block';
	const n = fd.data.node.querySelector<HTMLDivElement>('[data-id="set"]');
	set_node_cls(n, 'display-n', false);

	// 根据行数据编号查询隐患源的数据<{ res1: Array<{}>; res2: Array<{}>; }>
	const [res1, res2] = await nodejs('wyf-hManager/zj-000006/s001', {
		hidden_source: no
	});
	console.log('设置的隐患源数据', res1);
	console.log('设置的隐患源特性', res2);
	render(fd, res1, p001, 'p001', 'inner');
	render(fd, res2, p002, 'p002', 'inner');

	set(fd, 'no1', no);
	console.log('zj-000006:a001----end');
	return res2;
}
